package mdt.action;

import org.tigris.gef.base.Globals;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * Created by xiaobyu on 7/19/2016.
 */
public class StrictEdgeModeAction extends AbstractAction{

    public StrictEdgeModeAction() {
        super("Strict Edge");
        putValue(Action.SMALL_ICON, new ImageIcon(FontBoldAction.class.getResource("/resources/StrictEdgeMode.png")));
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (Globals.curEditor() == null) return;

        if (Globals.curEditor().isFreeEdgeMode()) {
            Globals.curEditor().setFreeEdgeMode(false);
        } else {
            Globals.curEditor().setFreeEdgeMode(true);
        }
    }
}
